package com.atguigu.config;

import com.atguigu.interceptors.LoginProtectInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@SuppressWarnings("all")
//TODO:配置类，配置拦截器，注册拦截类，配置拦截路径
public class WebMVCConfig implements WebMvcConfigurer {
    @Autowired    private LoginProtectInterceptor loginProtectInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginProtectInterceptor).addPathPatterns("/headline/**");
    }
}
